﻿using FreeSql.DataAnnotations;
using Jumei.Common.BaseModel;
using Jumei.Model.Business.OrdersManage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jumei.Model.Business.GoodsManage
{
    /// <summary>
    /// 虚拟商品表
    /// </summary>
    [Table(Name = "gd_goods_virtuals")]
    public class GoodsVirtualsEntity : EntityFull, ITenant
    {
        /// <summary>
        /// 租户Id
        /// </summary>
        [Column(Position = -10)]
        public long? TenantId { get; set; }

        /// <summary>
        /// 店铺ID
        /// </summary>
        public long ShopId { get; set; }

        /// <summary>
        /// 商品ID
        /// </summary>
        public long GoodsId { get; set; }

        public GoodsEntity Goods { get; set; }

        /// <summary>
        /// 卡券号
        /// </summary>
        [Column(StringLength = 20)]
        public string CardNo { get; set; }

        /// <summary>
        /// 卡券密码
        /// </summary>
        [Column(StringLength = 20)]
        public string CardPwd { get; set; }

        /// <summary>
        /// 订单ID
        /// </summary>
        public long OrderId { get; set; }

        public OrdersEntity Orders { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        [Column(StringLength = 20)]
        public string OrderNo { get; set; }

        /// <summary>
        /// 是否使用
        /// false:未使用 
        /// true :已下单
        /// </summary>
        public bool IsUse { get; set; } = false;

        /// <summary>
        /// 有效状态
        /// -1:未用 
        /// 1:已用
        /// </summary>
        public int IsValid { get; set; } = 1;
    }
}
